Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-parameters

Package Overview
Dependencies
Maintainers
4
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-parameters

Compile ES2015 default and rest parameters to ES5


Version published
Weekly downloads
25M
increased by4.24%
Maintainers
4
Weekly downloads
 
Created

What is @babel/plugin-transform-parameters?

The @babel/plugin-transform-parameters package is a Babel plugin that transforms function parameter features, such as default parameters, destructured parameters, and rest parameters, into ES5-compatible syntax. This transformation allows developers to use modern JavaScript features while maintaining compatibility with older environments that may not support these newer syntaxes natively.

What are @babel/plugin-transform-parameters's main functionalities?

Default Parameters

Transforms functions with default parameters to check for `undefined` and assign a default value if necessary. This allows for cleaner function signatures and easier parameter handling.

function log(message = 'Default message') { console.log(message); }

Destructured Parameters

Enables the use of destructuring in function parameters, transforming it into a series of variable assignments for compatibility. This simplifies the extraction of properties from objects passed as function arguments.

function greet({ name, age }) { console.log(`Hello ${name}, you are ${age} years old.`); }

Rest Parameters

Transforms rest parameters into a standard ES5 arguments pattern, allowing functions to accept an indefinite number of arguments as an array.

function concatenate(separator, ...strings) { return strings.join(separator); }

Other packages similar to @babel/plugin-transform-parameters

Keywords

FAQs

Package last updated on 05 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc